#include"my_stdio.h"
#include<unistd.h>

int main()
{
    mFILE* fp = mfopen("./log.txt", "a");
    if (fp == NULL)
    {
        return 1;
    }

    int cnt = 5;

    while(cnt)
    {
        char buffer[64];
        snprintf(buffer, sizeof(buffer), "hello message, munber is: %d\n", cnt);
        cnt--;

        mfwrite(buffer, strlen(buffer), fp);
        sleep(1);
    }
    return 0;
}
